/**  
 * @Title IfranchiserService.java
 * @date 2016年3月5日 下午3:04:02
 * @Copyright (c) 2016, unibroad.com Inc. All rights reserved.
 */
package com.strugglerz.biz.service;

import java.util.List;

import com.strugglerz.model.dalentity.SysResource;
import com.strugglerz.model.dalentity.SysRole;
import com.strugglerz.model.dalentity.SysUser;
import com.strugglerz.model.dalentity.SysUserRole;
import com.strugglerz.model.exception.BizHandleException;

/**
 * @Description 系统用户角色、权限服务
 * @Class ISysAuthService
 * @author suan@unibroad.com
 * @version V1.0
 */
public interface ISysAuthService {

	/**
	 * 用户授权
	 * 
	 * @return SysUserRole
	 * @throws BizHandleException
	 */
	public SysUserRole insertAuthorization(SysUser user, SysRole role) throws BizHandleException;

	/**
	 * 删除用户授权
	 * 
	 * @return
	 * @throws BizHandleException
	 */
	public boolean deleteAuthorization(SysUser user, List<SysRole> roles) throws BizHandleException;

	/**
	 * 查询用户有哪些角色
	 * 
	 * @return List<SysRole>
	 * @throws BizHandleException
	 */
	public List<SysRole> queryUserRoles(Integer userId) throws BizHandleException;

	/**
	 * 查询角色权限集
	 * 
	 * @param roleIds
	 * @return List<SysResource>
	 * @throws BizHandleException
	 */
	public List<SysResource> queryPermissions(List<Integer> roleIds) throws BizHandleException;

	/**
	 * 查看所有角色集合
	 * 
	 * @return List<String>
	 */
	public List<String> queryAllRoleCodes();

	/**
	 * 查看所有权限集
	 * 
	 * @return List<String>
	 */
	public List<String> queryAllPermissions();
}
